﻿using System;

namespace Results.ViewModels
{
    /// <summary>
    /// A specific season, like "2010"
    /// </summary>
    public class SeasonViewModel : ViewModelBase
    {
        /// <summary>
        /// Command to invoke when this group is selected
        /// </summary>
        public RelayCommand SeasonSelected { get; private set; }

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="season">A specific season, like "2010"</param>
        /// <param name="notifySelection">Methods to call if the user selects something</param>
        public SeasonViewModel(String season, INotifySelection notifySelection)
        {
            Season = season;
            SeasonSelected = new RelayCommand(p => notifySelection.SeasonSelected(season));
        }

        String _season;
        public String Season
        {
            get
            {
                return _season;
            }
            set
            {
                if (_season != value)
                {
                    _season = value;
                    Notify("Season");
                }
            }
        }

        Boolean _selected;
        public Boolean Selected
        {
            get
            {
                return _selected;
            }
            set
            {
                if (_selected != value)
                {
                    _selected = value;
                    Notify("Selected");
                }
            }
        }
    }
}
